#include "timer.h"

timer::timer()
{
    pLog = logmanager::getInstance();
    bStop = true;
    Mode = LIVE;
    pLog->AddMessage(SUCCESS, 1000 + OK, __LINE__, __FILE__,tr("Load timer"));

}

timer::~timer()
{
    pLog->AddMessage(SUCCESS, 1000 + OK, __LINE__, __FILE__,tr("Unload timer"));
}

void timer::run()
{
    do {
            QString time = QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz").left(12);
            emit timeSignal(time);
            msleep(500);

    } while (Mode != STOP);

}

void timer::setMode(int val)
{
    Mode = val;
}
